textarea {
  line-height: 1.4;
}

input, textarea {
  height: 30px;
  padding: 0 7px;
  border-radius: 4px;
  color: fadeout(@color-text, 5%);
  border: 1px solid @border-menu;

  &[type="checkbox"],
  &[type="radio"],
  &[type="range"] {
    padding: 0;

    &:focus {
      box-shadow: none;
    }
  }

  &[type="radio"] {
    width: 14px;
    height: 14px;
    outline: none;
    -webkit-appearance: none;
    border-radius: 50%;
    cursor: pointer;
    transition: border .1s ease;

    &:hover {
      border: 1px solid @blue;
    }

    &:checked {
      border: 4.5px solid @blue;
    }
  }

  &[type="file"] {
    padding: 0;
    border: 0;
    line-height: 1;

    &:focus {
      border: 0;
      box-shadow: none;
    }
  }

  &.roomy {
    padding: 7px 9px;
  }
}

input,
textarea,
select {

  &:focus {
    outline: 0;
    border: 1px solid fadeout(@color-link, 20%);
    box-shadow: 0 0 0 2px fadeout(@color-link, 80%);
  }

  &.error {
    border: 1px solid fadeout(shade(@red, 18%), 25%);

    &:focus {
      box-shadow: 0 0 0 2px fadeout(shade(@red, 20%), 85%);
    }
  }

  &.nofocus:focus {
    outline: 0;
    box-shadow: none;
    border: initial;
  }
}

// inline text input
input.inline {
  height: auto;
  border: 1px solid transparent;
  border-radius: 0;
  background: transparent;
  cursor: text;
  padding: 3px 5px;
  line-height: 1;

  &:focus,
  &:hover {
    border: 1px solid #ccc;
    box-shadow: none;
  }

  &:focus {
    background: #fff;
  }
}

input.underline {
  width: 100%;
  height: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  cursor: text;
  line-height: 1;
}

// custom file picker
.input-file-picker {
  display: flex;
  align-items: center;
  padding: 3px;
  border-radius: 2px;
  border: 1px solid @border-menu;
  color: @color-text--muted;

  span {
    flex: 1;
    padding-left: 3px;
  }
}

::-webkit-input-placeholder {
  color: rgba(0,0,0,.5);
  font-size: .8rem;
}

label {
  font-weight: 500;
}

input[disabled],
label[disabled] {

  &[data-tooltip] {
    cursor: help;

    * {
      cursor: help;
    }
  }
}

.toggle {
  &:extend(.flex);
  align-items: center;
  flex-direction: row-reverse;
  justify-content: space-between;
  margin-bottom: 10px;
  cursor: pointer;
  overflow: initial;

  * {
    cursor: pointer;
  }

  &.disabled {
    cursor: default;

    * {
      cursor: default;
    }
  }

  input {
    display: none;
  }

  .text {
    font-weight: 400;
  }

  .switch {
    display: inline-block;
    position: relative;
    width: 32px;
    height: 17px;

    &:before,
    &:after {
      position: absolute;
      display: block;
      content: '';
    }

    // the switch background
    &:before {
      width: 100%;
      height: 100%;
      border-radius: 40px;
      background: #dadada;
    }

    // the switch
    &:after {
      width: 11px;
      height: 11px;
      border-radius: 50%;
      left: 3px;
      top: 3px;
      background: #fafafa;
      transition: transform .15s ease;
    }
  }

  input:checked:not(:disabled) {

    + .switch:before {
      background: shade(@green, 15%);
    }

    + .switch:after {
      transform: translateX(15px);
    }
  }

  &.disabled {
    color: @color-text--light;
  }
}

label.checkbox-container {
  display: flex;
  align-items: center;
  height: 15px;
  font-weight: 400;

  input[type="checkbox"] {
    width: 15px;
    height: 15px;
    margin: 0 5px 0 0;
  }
}